﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace FantasyDraft2.Models
{
    public class Player
    {
        [Key]
        public int PlayerId { get; set; }

        public string Name { get; set; }
        public int Goals { get; set; }
        public int Assists { get; set; }
        public int TeamId { get; set; }
        public bool IsAvailable { get; set; }
        public bool IsInjured { get; set; }
        public bool IsActive { get; set; }

        //Player has a 1 to 1 relationship with User [TeamId is a foreign key that references User's TeamId] so a reference User object must be made to communicate.
        public virtual User User { get; set; }

        //Player has a 1 to Many relationship with Player Comments so an Enumnerable collection reference to Player Comments must be made to communicate.
        public IEnumerable<PlayerComment> PlayerComments { get; set; }

        //Player has a 1 to Many relationship with PlayerEvent so an Enumerable collection reference to PlayerEvent must be made to communicate.
        public IEnumerable<PlayerEvent> PlayerEvents { get; set; }
    }
}